﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="ConsultarFlotas.aspx.cs" Inherits="Empresa_ConsultarFlotas" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <style type="text/css">
        .labelFlota
        {
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div class="ui-widget ui-widget-content ui-corner-all" style="margin-top: 5px; margin-bottom: 5px;
        padding: 5px;">
        Ver como:
        <input type="radio" onclick="ShowTabs();" name="opt" checked="checked" />Pestañas
        <input type="radio" onclick="ShowLista();" name="opt" />
        Lista
    </div>
    <div>
        <asp:Repeater runat="server" ID="repFlota">
            <HeaderTemplate>
                <div id="tabs">
                    <ul runat="server" clientidmode="Static" id="lista">
                    </ul>
            </HeaderTemplate>
            <ItemTemplate>
                <div id="tabs-<%#Container.ItemIndex+1 %>">
                    <div class="labelFlota">
                        <br />
                        <asp:Label ID="lblFlota" runat="server" Font-Bold="true" /><hr />
                    </div>
                    <asp:GridView ID="grd" runat="server" AutoGenerateColumns="false" CellPadding="4">
                        <EmptyDataTemplate>
                            <div class="ui-widget">
                                <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
                                    <p>
                                        <span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
                                        No hay vehiculos asignados a esta Flota.</p>
                                </div>
                            </div>
                        </EmptyDataTemplate>
                        <Columns>
                            <asp:BoundField HeaderText="Tipo Vehiculo" DataField="TipoVehiculo">
                                <ItemStyle Width="150px" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Descripcion" DataField="Descripcion">
                                <ItemStyle Width="200px" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Patente" DataField="Patente">
                                <ItemStyle Width="70px" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Chofer" DataField="Chofer">
                                <ItemStyle Width="200px" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Activo">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl" Text='<%# Eval("Activo").ToString().ToLower()=="s"?"Si":"No" %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
            </ItemTemplate>
            <FooterTemplate>
                </div>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <script>
        function ShowTabs() {
            $("#lista").show();
            $("#tabs").tabs();
            $(".labelFlota").hide();
        }

        function ShowLista() {
            $("#tabs").tabs("destroy")
            $(".labelFlota").show();
            $("#lista").hide();
        }

        ShowTabs(); //por defecto
    </script>
</asp:Content>
